package dtd.PHS.VND_ExchangeRate;

import java.util.HashMap;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.TableRow;
import dtd.PHS.VND_ExchangeRate.VCB_ERate.MyCurrency;

public class SMSRowItem extends TableRow{

	private ImageButton ib;
	private CheckBox cb;

	public SMSRowItem(Context context) {
		super(context);
		initItem();
	}
	
	public SMSRowItem(Context context,AttributeSet attrs) {
		super(context,attrs);	
		initItem();
	}

	private void initItem() {
		String service = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater li = (LayoutInflater) getContext().getSystemService(service);
		li.inflate(R.layout.row_sms_item, this, true);
		
		this.ib = (ImageButton)findViewById(R.id.SMSRowItem_ib01);
		this.cb = (CheckBox)findViewById(R.id.SMSRowItem_cb01);
		
	}

	public void setFlag(MyCurrency c) {
		ib.setImageResource((int)MyUtility.mapCurrency2ResourceID.get(c));
	}

	public void mappingCheckboxCurrency(MyCurrency c,
			HashMap<CheckBox, MyCurrency> mapCB2Currency) {
		mapCB2Currency.put(this.cb, c);
	}
}
